<template>
  <div>
    <Row>
      <i-col span="24">
        <Table :columns="columns1" :data="data1">
          <template slot-scope="{ row }" slot="id">
              <a @click="goToDetail(row.id)">{{ row.id }}</a>
          </template>
        </Table>
      </i-col>
    </Row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      columns1: [
        {
          title: 'id',
          slot: 'id'
        },
        {
          title: 'Name',
          key: 'name'
        },
        {
          title: 'Age',
          key: 'age'
        },
        {
          title: 'Address',
          key: 'address'
        }
      ],
      data1: [
        {
          name: '仓库1',
          age: 18,
          id: 1,
          address: 'New York No. 1 Lake Park',
          date: '2016-10-03'
        },
        {
          name: '仓库2',
          age: 24,
          id: 2,
          address: 'London No. 1 Lake Park',
          date: '2016-10-01'
        },
        {
          name: '仓库3',
          age: 30,
          id: 3,
          address: 'Sydney No. 1 Lake Park',
          date: '2016-10-02'
        },
        {
          name: '仓库4',
          age: 26,
          id: 4,
          address: 'Ottawa No. 2 Lake Park',
          date: '2016-10-04'
        }
      ]
    }
  },
  methods: {
    goToDetail (id) {
      this.$router.push({
        name: 'storeDetail',
        query: {
          id
        }
      })
    }
  }
}
</script>

<style lang="less">
</style>
